package com.mdxl.layer_cj.dao;

import com.mdxl.layer_cj.shiro.User;
import org.apache.ibatis.jdbc.SQL;
import org.springframework.util.StringUtils;

public class MybatisSqlProvider {

    public String insertUser(User user){
        SQL sql = new SQL();
        sql.INSERT_INTO("user");
        if (user.getUsername() != null && user.getUsername() !=""){
            sql.VALUES("username","#{username,jdbcType=VARCHAR}");
        }
        if (!StringUtils.isEmpty(user.getPassword())){
            sql.VALUES("password","#{password,#{password,jdbcType=VARCHAR}");
        }
        return sql.toString();
    }
}
